package v2

import "encoding/json"


type Parser interface {
	Parser(contents []byte,url string) ParseResult
	Serialize() (name string,args interface{})
}

// 请求，包括URL和指定的解析函数
type Request struct {
	Url string
	Parse Parser
}
// 解析结果
type ParseResult struct {
	Requests []Request
	Items 	 []Item
}


type Item struct {
	Url 	string
	Id 		string
	Type 	string
	Payload interface{}
}






type Profile struct {
	Name, Height, Weight, Job, JobAddress string
	Edu, HasChild, Jiguan, Age, Marriage  string
	Sex                                   string
	Income                                string
}
// todo Map 转 Struce
func Map2Profile(o interface{}) Profile  {
	str, _ := json.Marshal(o)
	p := Profile{}
	json.Unmarshal(str, &p)
	return p
}